package com.sjd.web.api.farm;

import com.sjd.common.core.controller.BaseController;
import com.sjd.common.core.page.TableDataInfo;
import com.sjd.common.utils.PageUtils;
import com.sjd.farm.domain.dto.goods.SjdAppFarmGoodsQueryRequestDTO;
import com.sjd.farm.domain.dto.goods.SjdAppFarmGoodsQueryResponseDTO;
import com.sjd.farm.service.SjdFarmGoodsService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author : Mr.s
 * @version : 1.0
 * @description : 微信农场商品
 * @date : 2022-01-30 23:04
 */
@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/weixin/api/ma/farm/goods")
public class WxFarmGoodsApi extends BaseController {

    @Autowired
    private SjdFarmGoodsService sjdFarmGoodsService;

    /**
     * 查询列表
     * @param requestDTO requestDTO
     * @return return
     */
    @GetMapping(value = "/goods-list")
    public TableDataInfo goodsList(SjdAppFarmGoodsQueryRequestDTO requestDTO){
        startPage();
        List<SjdAppFarmGoodsQueryResponseDTO> responseDTOList = sjdFarmGoodsService.appQueryFarmGoods(requestDTO);
        return getDataTable(responseDTOList);
    }

}
